#Linux for Python Coding
Explore tagged Tumblr posts
neverburnbooks · 9 months ago
Text
Tumblr media
Skywave Linux v5.3 is available for download! It is a self-contained live Linux iso for shortwave listening on internet based SDR sites. The picture is from a nice night enjoying CBC Radio 1, picked up on a receiver in Newfoundland, Canada
Get the iso image, burn it to a USB stick, boot the system and have fun. Shut down and unplug the USB, your PC never knew it was running a live Linux system...
0 notes
adafruit · 3 months ago
Text
Testing Dark Castle with audio on the RP2350 Fruit Jam 🕹️🏰
Jepler spent a bunch of time this week working on getting audio working on the pico-umac port https://github.com/jepler/pico-mac/tree/rp2350-fruitjam to Fruit Jam
. Audio on the hardware we're emulating is pretty straightforward: every scanline of the video generator also pops out one byte of PWM data. We have 370 horizontal lines—352 visible and 18 during the vsync—and a 60.15 Hz refresh rate for 22.255 KHz audio approximately. That data is written to $1FD00 http://www.mac.linux-m68k.org/devel/plushw.php . That data is being piped over I2S to the MAX98357
and to a speaker for now.
So, of course, the first thing we have to try out is Dark Castle
: famous for great audio and being a surprisingly hard game to play! The audio sounds really good though :)
27 notes · View notes
codingquill · 2 years ago
Text
What happens when you start your computer ? ( Booting a computer )
We studied this in the lecture today, and it was quite interesting. What makes something a hundred times simpler than it is? Creating a story about it. That's why I made this super fun dialog that will help you understand it all.
I've set up a drive to compile everything I create related to the Linux operating system. Feel free to explore it for more details on the topics discussed in the conversation below. Check it out here.
Tumblr media
Have a fun read, my dear coders!
In the digital expanse of the computer, Pixel, the inquisitive parasite, is on a microventure with Binary, a wise digital guide. Together, they delve into the electronic wonders, uncovering the secrets hidden in the machine's core.
Pixel: (zooming around) Hey there! Pixel here, on a mission to demystify the tech wonders . There's a creature named Binary who knows all the ins and outs. Let's find them!
Binary: (appearing with a flicker of pixels) Pixel, greetings! Ready to explore what happens inside here?
Pixel: Absolutely! I want the full scoop. How does this thing come alive when the human outside clicks on "start"?
Binary: (with a digital chuckle) Ah, the magic of user interaction. Follow me, and I'll reveal the secrets.
(They traverse through the circuits, arriving at a glowing portal.)
Pixel: (inquiring) What's the deal with this glowing door?
Binary: (hovering) Pixel, behold the BIOS - our machine's awakening. When the human clicks "start," the BIOS kicks in, checking if our components are ready for action.
(They proceed to observe a tiny program in action.)
Pixel: (curious) Look at that little messenger running around. What's it up to?
Binary: (explaining) That, Pixel, is the bootloader. It plays courier between the BIOS and the operating system, bringing it to life.
Pixel: (excitedly buzzing) Okay! How does the computer know where to find the operating system?
Binary: Ah, Pixel, that's a tale that takes us deep into the heart of the hard disk. Follow me.
(They weave through the digital pathways, arriving at the hard disk.)
Pixel: (curious) Huh? Tell me everything!
Binary: Within this hard disk lies the treasure chest of the operating system. Let's start with the Master Boot Record (MBR).
(They approach the MBR, Binary pointing to its intricate code.)
Binary: The MBR is like the keeper of the keys. It holds crucial information about our partitions and how to find the operating system.
Pixel: (wide-eyed) What's inside?
Binary: (pointing) Take a look. This is the primary boot loader, the first spark that ignites the OS journey.
(They travel into the MBR, where lines of code reveal the primary boot loader.)
Pixel: (in awe) This tiny thing sets the whole show in motion?
Binary: (explaining) Indeed. It knows how to find the kernel of the operating system, which is the core of its existence.
(They proceed to the first partition, where the Linux kernel resides.)
Pixel: (peering into the files) This is where the OS lives, right?
Binary: (nodding) Correct, Pixel. Here lies the Linux kernel. Notice those configuration files? They're like the OS's guidebook, all written in text.
(They venture to another partition, finding it empty.)
Pixel: (confused) What's the story with this empty space?
Binary: (smirking) Sometimes, Pixel, there are barren lands on the hard disk, waiting for a purpose. It's a canvas yet to be painted.
Pixel: (reflecting) Wow! It's like a whole universe in here. I had no idea the operating system had its roots in the hard disk.
(They continue their microventure, navigating the binary landscapes of the computer's inner world.Pixel gazes at the screen where choices appear.)
Pixel: What's happening here?
Binary: (revealing) This is where the user picks the operating system. The computer patiently waits for a decision. If none comes, it follows the default path.
(They delve deeper into the digital code, where applications start blooming.)
Pixel: (amazed) It's like a digital garden of applications! What's the enchantment behind this?
Binary: (sharing) Here, Pixel, is where the applications sprout to life. The operating system nurtures them, and they blossom into the programs you see on the screen.
Pixel: (excited) But how does the machine know when the human clicks "start"?
Binary: It's the BIOS that senses this initiation. When the human triggers "start," the BIOS awakens, and we embark on this mesmerizing journey.
387 notes · View notes
jupyter-official · 5 months ago
Text
made a gimmick blog of my own (inspired by the linux blogs)
not affiliated with the ipython or anaconda projects
12 notes · View notes
totallyveryallosexual · 5 months ago
Text
Learning programming is crazy because what do you mean I spent four hours writing seven lines.
6 notes · View notes
enaistyping · 9 months ago
Text
Sep 17, 2024
Update from the last week or so:
School is going somewhat well; I was falling behind in some of my classes for whatever reason but I've managed to catch up and stay on top of things, which I found is very difficult for me sometimes. I struggle to stay motivated to work on homework and put the necessary time in for studying, but it is important to remember discipline >>> motivation. I've found that once I start working on a project for a few minutes without distraction, it pushes me into the working mindset and it is easier to stay focused on that task.
Tumblr media
(snippet from my first comp sci lab this year ^^)
In computer science news:
I have joined two (2) computer and technology related clubs this year!
Linux Users Group : a club dedicated to the learning of everything Linux based. Terminal work to Ricing !
Unmanned Arial Systems Club (UAS) : a club dedicated to drone projects, testing and competing. The main goal of the club is to compete with other drones in professional competitions to land parcels onto specific targets. There are many different moving parts to the club in terms of what one can work on; hardware, software and flying the drone itself! I really am enjoying this club even after two meetings, it is very interactive and I feel very welcomed and encouraged here ! :3
One thing that is difficult about being a women in a tech field with tech interests is that very often I am the only girl at these functions. Luckily there are many people who are welcoming to new members and ideas in these organizations, but it is still a challenge to fit in as a women sometimes.
One final note; a personal project! I've been ricing my Ubuntu desktop with Conky which has been a great learning experience and a challenge. I am so happy with the knowledge I have gained from this project, even though I am not fully done. If anyone has any tips or ideas for ricing with Conky on Ubuntu, please let me know!
Study hard and know that you are loved ! <3
Tumblr media
11 notes · View notes
codebegins · 9 months ago
Text
No matter, What your background is, You must learn at least one programming language.
13 notes · View notes
mobcodercom · 1 month ago
Text
Why Choose Mobcoder for App Development Services in Singapore?
Looking for expert App Development Services in Singapore? Mobcoder delivers cutting-edge mobile solutions tailored to your business needs. With a team of skilled developers, we ensure top-quality, scalable, and user-friendly applications. Partner with Mobcoder for innovative app development that drives growth and engagement. Discover why we're a trusted name in Singapore’s tech scene.
Tumblr media
2 notes · View notes
diginexusnet · 9 months ago
Text
Tumblr media
🎨 Color Highlight: Trust in Blue! 💙
At DNN, our Primary Color is more than just a shade—it's a symbol of trust and authority. The deep Very Dark Blue (#001043) represents the confidence and reliability we bring to every project.
🔹 Trust us to bring your digital dreams to life! 🔹 Stay connected for more updates on what’s coming soon.
5 notes · View notes
learninghub-betasys-ai · 3 months ago
Text
How AI is Reshaping the Way We Learn
Tumblr media
echnology is rapidly transforming education. With AI-powered platforms, learners can now enjoy personalized experiences that adapt to their goals and pace. One such platform is LearningHub by Betasys, a free tool that helps students and professionals upskill with smart recommendations in AI, ML, AWS, and more. Explore it here 👉 https://learninghub.betasys.ai
2 notes · View notes
incoderslab · 3 months ago
Text
Tumblr media
3 notes · View notes
adafruit · 3 months ago
Text
Browsing HyperCard stacks on our RP2350-based Fruit Jam 🍏📂
With a little more tweaking, we've got a nice big 12MB disk image loading into our Pico-Mac port https://github.com/jepler/pico-mac/tree/rp2350-fruitjam to the Fruit Jam https://www.adafruit.com/product/6200 — that 16MB of internal flash is coming in super useful now!
That means not only can we run System 6 but also install some nice software like HyperCard https://en.wikipedia.org/wiki/HyperCard !
As kids, we loved playing and making HyperCard stacks, so it's neat to see that we can still navigate the classics on an RP2350. Many stacks have music or sound effects, so we'll revisit these once we get audio playback working.
18 notes · View notes
codingquill · 2 years ago
Text
What is the kernel of an operating system ?
You can think of the kernel as the core component of an operating system, just like the CPU is the core component of a computer. The kernel of an operating system, such as the Linux kernel, is responsible for managing system resources ( such as the CPU, memory, and devices ) . The kernel of an operating system is not a physical entity that can be seen. It is a computer program that resides in memory.
Key points to understand the relationship between the kernel and the OS:
The kernel acts as the intermediary between the hardware and the software layers of the system. It provides a layer of abstraction that allows software applications to interact with the hardware without needing to understand the low-level details of the hardware
The kernel controls and manages system resources such as the CPU, memory, devices, and file systems. It ensures that these resources are allocated and utilized efficiently by different processes and applications running on the system.
The kernel handles tasks like process scheduling, memory management, device drivers, file system access, and handling interrupts from hardware devices.
The kernel can be extended through the use of loadable kernel modules (LKM). LKMs allow for the addition of new functionality or device drivers without modifying the kernel itself.
225 notes · View notes
skyeqt · 8 months ago
Text
I wrote a quine, without strings, in a calculator
Okay so I should probably clarify some things, the calculator in question (dc) is more of a "calculating tool", it is built into most linux distributions, and it is a command line tool. I should also clarify "without strings", because dc itself does support strings, and I do actually use strings, however, I do not use string literals (I'll explain that more later), and I only use strings that are 1 character long at most.
So first of all, why did I decide to do this, well, this all started when I found a neat quine for dc:
[91Pn[dx]93Pn]dx
If you're curious about how this works, and what I turned it into, it'll be under the cut, for more technical people, you can skip or skim the first text block, after that is when it gets interesting.
So first of all, what is a quine, a quine is a computer program that outputs its own source code, this is easier said than done, the major problem is one of information, the process of executing source code normally means a lot of code, for a little output, but for a quine you want the exact same amount of code and output. First of all, let's explain dc "code" itself, and then this example. Dc uses reverse polish notation, and is stack-based and arbitrary precision. Now for the nerds reading this, you already understand this, for everybody else's benefit, let's start at the beginning, reverse polish notation means what you'd write as 1+1 normally (infix notation), would instead be written as 1 1 +, this seems weird, but for computers, makes a lot of sense, you need to tell it the numbers first, and then what you want to do with them. Arbitrary precision is quite easy to explain, this means it can handle numbers as big, or as small, or with as many decimal points as you want, it will just get slower the more complex it gets, most calculators are fixed precision, have you ever done a calculation so large you get "Infinity" out the other end? That just means it can't handle a bigger number, and wants to tell you that in an easy to understand way, big number=infinity. Now as for stack based, you can think of a stack a bit pile a pile of stuff, if you take something off, you're probably taking it off the top, and if you put something on, you're probably also putting it ontop. So here you can imagine a tower of numbers, when I write 1 1 +, what I'm actually doing is throwing 1 onto the tower, twice, and then the + symbol says "hey take 2 numbers of the top, add them, and throw the result back on", and so the stack will look like: 1 then 1, 1, then during the add it has nothing, then it has a 2. I'm going to start speeding up a bit here, most of dc works this way: you have commands that deal with the stack itself, commands that do maths, and commands that do "side things". Most* of these are 1 letter long, for example, what if I want to write the 1+1 example a little differently, I could do 1d+, this puts 1 on the stack (the pile of numbers), then duplicates it, so you have two 1s now, and then adds those, simple enough. Lets move onto something a little more complex, let's multiply, what if I take 10 10 * well I get 100 on the stack, like you may expect, but this isn't output yet, we can print it with p, and sure enough we see the 100, I can print the entire stack with f, which is just 100 too for now, I can print it slightly differently with n, I'll get into that later, or I can print with P which uhhhh "d", what happened there? Well you see d is character 100 in ASCII, what exactly ASCII is, if you don't know, don't worry, just think of it as a big list of letters, with corresponding numbers. And final piece of knowledge here will be, what is a string, well it's basically just some text, like this post! Although normally a lot shorter, and without all the fancy formatting. Now with all that out of the way, how does the quine I started with actually work?
From here it's going to get more technical, if you're lost, don't worry, it will get even more technical later :). So in dc, you make a string with [text], so if we look at the example again, pasted here for your convenience
[91Pn[dx]93Pn]dx
it makes one long string at the start, this string goes onto the stack, and then gets duplicated, so it's on the stack twice, then it's executed as a macro. In technical language, this is just an eval really, in less technical language, it just means take that text, and treat it like more commands, so you may see, it starts with 91P, 91 is the ASCII character code for [, which then gets printed out, not coincidentally, this is the start of the program itself. Now the "n" that comes afterwards, as I said earlier, this is a special type of print, this means print without newline (P doesn't use newlines either), which means we can keep printing without having to worry about everything being on separate lines, now what is it printing? Well what's on top of the stack, oh look, it's the copy of the entire string, which once again not coincidentally, is the entire inside of the brackets, so now we've already printed out the majority of the program, now dx is thrown on the stack, which as you may notice is the ending of the program, but we won't print it yet, we'll first print 93 as a character, which is "]", and then print dx, and this completes the quine, the output is now exactly the same as the input. Now, I found this some time ago, and uncovered it again in my command history, it's interesting, sure, but you may notice it's not very... complicated, the majority of the program is just stored as a string, so it already has access to 90% of itself from the start, and just has to do some extra odd jobs to become a full quine, I wanted to make this worse. I started modifying it, doing some odd things, which I won't go into, I wanted to remove the numbers, replacing it entirely with calculations from numbers I already have access to, like the length of a string, this wasn't so hard, but then I hit on what this post is about "can I make this without using string literals"
Can I make this without using string literals?
Yes, I can! And it took a whole day. I'll start by explaining what a string literal is, but this will largely be the end of my explaining, from here it's about to get so technical and I don't want to spend all day explaining things and make this post even longer than it's already going to be. A string literal is basically just the [text] you saw earlier, it's making a string by just, writing out the string. In dc there's only 1 other way to make a string, the "a" command, which converts a number, into a 1 character string, using the number as an ASCII character code. Strings in dc are immutable, you can only print, execute, and move them around with the usual stack operations, you cannot concatenate, you cannot modify in any way, the only other things you can do with a string, is grab the first character, or count the characters, but as I just explained, our only way to make strings creates a 1 character string, which cannot be extended, so the first character is just, the entire thing, and the length is always 1, so neither of these are useful to us. So, now we understand what the restriction of no string literals really is (there are more knock on restrictions I'll bring up later), let's get into the meat of it, how I did it.
So I've just discussed the way I'll be outputting the text (this quine will need text, since all the outputting commands are text!), with the "a" command and the single character strings it produces, let's now figure out some more restrictions. So any programmers reading this are going to be horrified by what I'm about to say. If I remove string literals, dc is no longer Turing Complete, I am trying to write a quine in a language (subset) that is not Turing Complete, and can only output 1 character at a time**. You can't loop in dc, but you can recurse, with macros, which are effectively just evaling a string, you can recurse, since these still operate on the main stack, registers, arrays, etc, they can't be passed or return anything, but this doesn't matter. Now I cannot do this, because if I only have 1 character strings via "a" then I can't create a macro that does useful work, and executes something, since that would require more than 1 command in it. So I am limited to only linear execution***. Now lets get into the architecture of this quine, and finally address all these asterisks, since they're finally about to be relevant, I started with a lot of ideas for how I'd architect these, I call these very creatively by their command structure, dScax/dSax, rotate-based execution, all-at-once stack flipping, or the worst of them all, LdzRz1-RSax (this one is just an extension of rotate-based execution), I won't bother explaining these, since these are all failed ideas, although if anybody is really curious, I might explain some other time, for now, I'll focus on the one that worked, K1+dk: ; ;ax, or if you really want to try to shoehorn a name, Kdkax execution, now, anybody intimately familiar with dc, will probably be going "what the fuck are you doing", and rightly so, so now, let's finally address the asterisks, and get into what Kdkax execution actually means, and how I used it.
*"Most commands are 1 character long, but there are exceptions, S, L, s, l, :, ; and comparisons, only : and ; are relevant here, so I won't bother with the rest, although some of the previous architectures used S and L as you may have seen. : and ; are the array operations, there are 256 arrays in dc, each one named after a character, if I want to store into array "a" I will write :a, a 2 character sequence, same for loading from array "a" ;a, I'll get into exactly how these work later **I can only output 1 character at a time with p, P, and n, but f can output multiple characters, the only catch being it puts a newline between each element of the stack, and because I can only put 1 character into each stack element, it's a newline between each character for me (except for numbers). I'll get into what this means exactly later ***I can do non-linear execution, and in fact, it was required to make this work, but I can only do this via single character macros, which is, quite the restriction to put it lightly
So I feel like I've been dancing around it now, what does my quine actually look like, well, I wanted to keep things similar to the original, where I write a program, I store it, then I output it verbatim, with some cleanup work. However, I can't store the program as strings, or even characters, I instead need to store it as numbers, and the easiest way to do this, is to store it as the char codes for dc commands, so if I want to execute my 1d+ example from before, I instead store it as 49 100 43, which when you convert them back to characters, and then execute them in sequence, to do the same thing, except I can store them, which means I can output them again, without needing to re-create them, this will come in handy later. So, well how do I execute them, well, ax is the sequence that really matters here, and it's something all my architectures have in common, it converts them to a character, then executes them, in that order, not so hard, except, I'm not storing them anymore, well then if you're familiar with dc, you might come across my first idea, dScax, which, for reasons you will understand later, became dSax, this comes close to working, it does store the numbers in a register, and execute them, but this didn't really end up working so well. I think the next most important thing to discuss though, is how I'm outputting, as I mentioned earlier "f" will be my best friend, this outputs the entire stack, this is basically the whole reason this quine is possible, it's my only way of outputting more characters from the program, than the program itself takes up, since I can't loop or recurse, and f is the only character that outputs more than 1 stack element at once, it is my ticket to outputting more than I'm inputting, and thereby "catching up" with all the characters "wasted" on setup work. So now, as I explained earlier, f prints a newline between each stack element, and I can only create 1 character stack elements, and because in a quine the output must equal the input, this also means the input must equal the output. And because I just discovered an outputting quirk, this means my input must also match this quirk, if I want this to be a quine, so, my input is limited to 1 character, or 1 number, per line, since this is the layout my stack will take, and therefore will be the layout of my output. So what does this actually mean, I originally thought I couldn't use arrays at all, but, this isn't true, the array operations are multiple character sequences yes, but turns out, there actually are multiple characters per line, there's also a linefeed character. And since there is an array per ASCII character, I am simply going to be storing everything in "array linefeed"! So now, with all of this in mind, what does the program actually look like.
Let's take a really simple example, even simpler than earlier, let's simply store 1 and then print it, this seems simple enough, 1p does it fine, but, lets convert it to my format, and it's going to get quite long already, in order to prevent it getting even longer, I'll use spaces instead of newlines, just keep in mind, they're newlines in the actual program
112 49 0 k K 1 + d k : K 1 + d k : 0 k K 1 + d k ; K 1 + d k ; 0 k K 1 + d k ; a x K 1 + d k ; a x
now, what the fuck is going on here, first of all, I took "1p" and converted both characters into their character codes "49 112" and then flipped them backwards (dw about it), then, I run them through the Kdkax architecture. What happens is I initialise the decimal points of precision to 0, then, I increment it, put it back, but keep a copy, and then run the array store, keep in mind, this is storing in array linefeed, but what and where is it storing? Its index is the copy of the decimal points of precision I just made, and the data it's storing at that index, is whatever comes before that on the stack, which, not coincidentally, is 49, the character code for the digit "1", then I do the same process again, but this time, the decimal points of precision is 1, not 0, and the stack is 1 shorter. So now, I store 112 (the character code for p), in index 2 of array linefeed, now you may notice, the array is looking the exact same as the original program I wanted to run, but, in character code form, it is effectively storing "1p", but as numbers in an array, instead of characters in a string. I then reset the precision with 0k, and start again, this time with the load command, which loads everything back out, except, now flipped, the stack originally read 49 112, since that's the order I put them on, the top is 49, the last thing I put on, but after putting them into the array, and taking them back out, now I'm putting on 112 last instead, so now the stack reads 112 49, which happens to be the exact start of the code, this will be important later. For now, the important part is, the numbers are still in the array, taking them out just makes a copy, so, this time I take them out again, but rather than just storing them, I convert them to a character, and then execute them, 49 -> 1 -> 1 on the stack, 112 -> p -> print the stack, and I get 1 printed out with the final x. Now this may not seem very significant, but this is how everything is going to be done from here on out.
So, what do I do next? Well now's time to start on the quine itself, you may have noticed in the last example, I mentioned how at one point, the stack exactly resembles the program itself, or at least the start of it, this is hopefully suspicious to you, so now you may wonder, what if my program starts with "f" to print out the entire stack? Well, I get all the numbers back, i.e. I get the start of the file printed out, and this will happen, no matter how many numbers (commands) I include, now we're getting somewhere, so if I write fc at the start of my program (converted into character codes and then newline separated) then I include enough copies of the whole Kdkax stuff to actually store, load, and execute it, then I can execute whatever I want, and I'll get back everything except the Kdkax stuff itself, awesome! So now we come onto, how do I get back the "Kdkax stuff", and more importantly, what are my limitations executing things like this, can I just do anything?
Well, put simply, no, I cannot use multicharacter sequences, and I actually can't this time, because it's being executed as a single character macro, I don't have a newline to save me, and I just get an error back, so okay that's disappointing. This multicharacter sequence rule means I also can't input numbers bigger than 1 digit, because remember, the numbers get converted into characters and then executed, and luckily, executing a number, just means throwing it on the stack, so I'm good for single digit numbers. Then in terms of math (I know, this is a post about a calculator and only now is the maths starting), I can't do anything that produces decimals, since the digits of precision is constantly being toyed with, and I also can't use the digits of precision as a storage method either, because it's in use. I can actually use the main stack though! It's thankfully left untouched (through a lot of effort), so I'm fine on that front. Other multicharacter sequences include negative numbers, strings (so I can't cheese it, even here), and conditionals.
So it was somewhere around here, I started to rely on a python script I wrote for some of the earlier testing, and I modified it to this new Kdkax architecture when I was confident this was the way forwards. It converts each character into a character code, throws that at the start, and then throws as many copies of the store, load, and execute logic as I need to execute the entire thing afterwards. This allows me to input (mostly) normal dc into the input, just keeping in mind that any multicharacter sequences will be split up. So now I can start really going, and I'll speed up from here, effectively, what I need to do, is write a dc program, that can output "0 k", then "K 1 + d k :" repeated as many times as there are characters in my program, then "0 k" again, then "K 1 + d k ;" repeated just as many times, then "0 k" again, then "K 1 + d k ; a x" also repeated just as many times, without using strings, multicharacter sequences, loops, branches, recursion, any non-integer maths, with a newline instead of a space in every sequence above. Doable. The program starts with fc, like I mentioned, this prints out all the numbers at the start, and leaves us with a clean stack, I'll explain in detail how I output the "0 k" at the start, and leave the rest as an exercise to to the reader. I want to do this by printing the entire stack, so I want to put it on backwards, k first, k is character code 107 in decimal, and I can't input this directly, because I can't do anything other than single digit numbers, so maths it is, here I abuse the O command, which loads the output base, which is 10 by default, and I then write "OO*7+a", which is effectively character((10*10)+7) written in a more normal syntax, this creates "k" on the stack, and then I can move onto 0, for which I write "0", since a number just puts itself on the stack, no need to create it via a character code, I can just throw it on there, keep in mind this will all get converted to 79 79 42 55 43 97 48, but the python script handles this for me, and I don't need to think about it. The stack now reads "0 k" and I can output this with f, and clear the stack, I then do the same deal for "K 1 + d k :", the next "0 k", "K 1 + d k ;" but here I do something a little different, because I want to output "K 1 + d k ; a x" next (after the "0 k" again), I don't clear the stack after outputting "K 1 + d k ;", and instead, I put "a x" on the stack, and then use the rotate stack commands to "slot it into place" at the end, this is a neat trick that saves some extra effort, it makes printing the "0 k" in between more difficult, but I won't get into that. For now the important part, is the output of my program now looks something like this "(copy of input numbers) 0 k K 1 + d k : 0 k K 1 + d k ; 0 k K 1 + d k ; a x" this is amazing, this would be the correct output, if my program was only 1 character long at this point, now keep in mind I'm writing non-chronologically, so my program never actually looked like this, but if you're following along at home you should have this at this point:
fcOO*7+a0fcaO5*8+aOO*7+aOO*aO4*3+aO4*9+a355**afcOO*7+aOO*aO4*3+aO4*9+a355**af0nOanOO*7+anOanOO*2O*+aOO*3-a08-R08-Rf
definitely longer than 1 character, you might think at this point, it's just a matter of spamming "f" until you get there, but unfortunately, you'll never get there, every extra "f" you add, requires an extra copy of the store, load, execute block in the program, so you're outpaced 3 to 1, so what do you do about this? You print 4 at once! I want the stack to look like "K 1 + d k : K 1 + d k : K 1 + d k : K 1 + d k :" and similarly for the other steps, and then I can spam f with greater efficiency! This was somewhat trivial for the first 2, but for the ax, because I'm using the rotate to push it at the end, I need to do this 4 times too, with different rotate widths, not too hard. And now, I can finally get there, but how many times do I spam f? Until my program is exactly 3/4s printing on repeat, which makes sense if you think about it, and below, is finally the program I ended up with
fcOO*7+a0fcO5*8+aOO*7+aOO*aO4*3+aO4*9+a355**aO5*8+aOO*7+aOO*aO4*3+aO4*9+a355**aO5*8+aOO*7+aOO*aO4*3+aO4*9+a355**aO5*8+aOO*7+aOO*aO4*3+aO4*9+a355**affffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffcOO7+a0fcO5*9+aOO*7+aOO*aO4*3+aO4*9+a355**aO5*9+aOO*7+aOO*aO4*3+aO4*9+a355**aO5*9+aOO*7+aOO*aO4*3+aO4*9+a355**aO5*9+aOO*7+aOO*aO4*3+aO4*9+a355**affffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0nOanOO*7+anOanOO*2O*+aOO*3-a08-R08-ROO*2O*+aOO*3-a082-R082-ROO*2O*+aOO*3-a083-R083-ROO*2O*+aOO*3-a084-R084*-Rffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
I say finally, but this is actually pre-python script! The final program I actually ended up with will instead be included in a reblog, because it really needs its own cut. But anyway, this was how I wrote a quine, for a calculator, without using string literals.
4 notes · View notes
linuxtldr · 6 months ago
Text
2 notes · View notes
trust565 · 2 months ago
Text
Tumblr media
0 notes